<template>
  <div class="warp">
    <div class="header"></div>
    <div class="title">家庭成员信息</div>
    <div class="main-list">
      <div class="main-item">
        <div class="main-item-lable">申请人</div>
        <input class="main-item-input" type="text" />
      </div>
      <div class="main-item">
        <div class="main-item-lable">身份证号</div>
        <input class="main-item-input" type="text" />
      </div>
      <div class="main-item" @click="show=true">
        <div class="main-item-lable">与申请人关系</div>
        <input class="main-item-input" type="text" readonly />
        <van-icon name="arrow-down" size="16" color="#0882F3" />
      </div>
      <div class="main-item">
        <div class="main-item-lable">性别</div>
        <div class="main-item-radio">
          <van-radio-group v-model="radio">
            <van-radio name="1">男</van-radio>
            <van-radio name="2">女</van-radio>
          </van-radio-group>
        </div>
      </div>
      <div class="main-item">
        <div class="main-item-lable">工作单位或院校（全称）</div>
        <input class="main-item-input" type="text" />
      </div>
      <div class="main-item">
        <div class="main-item-lable">月收入</div>
        <input class="main-item-input" type="text" />
      </div>
      <div class="main-item">
        <div class="main-item-lable">居住证受理时间</div>
        <input class="main-item-input" type="text" />
      </div>
      <div class="main-item">
        <div class="main-item-lable">户籍地址</div>
        <input class="main-item-input" type="text" />
      </div>
      <div class="main-item">
        <div class="main-item-lable">联系电话</div>
        <input class="main-item-input" type="text" />
      </div>
    </div>
    <div class="main-add-list">
      <van-icon name="add-o" size="20" />
      <span>添加家庭成员</span>
    </div>
    <div class="title">申请类型</div>
    <div class="main-upload">
      <div class="main-upload-item">
        <div class="main-upload-item-lable">身份证</div>
        <div class="main-upload-item-status">已上传</div>
        <div class="main-upload-item-btn">
          <van-uploader>
            <van-icon name="upgrade" size="16" />
            <span>上传</span>
          </van-uploader>
        </div>
      </div>
      <div class="main-upload-item">
        <div class="main-upload-item-lable">户口簿</div>
        <div class="main-upload-item-status"></div>
        <div class="main-upload-item-btn">
          <van-uploader>
            <van-icon name="upgrade" size="16" />
            <span>上传</span>
          </van-uploader>
        </div>
      </div>
      <div class="main-upload-item">
        <div class="main-upload-item-lable">居住证</div>
        <div class="main-upload-item-status">已上传</div>
        <div class="main-upload-item-btn">
          <van-uploader>
            <span>重新上传</span>
          </van-uploader>
        </div>
      </div>
    </div>
    <div class="footer">
      <div class="footer-btn" @click="saveForm">下一步</div>
    </div>

    <van-action-sheet v-model="show" :actions="actions" @select="onSelect" />
  </div>
</template>

<script>
export default {
  name: 'familyInfo',
  data () {
    return {
      radio: '',
      show: false,
      actions: [
        { name: '选项' },
        { name: '选项1' },
        { name: '选项2' }
      ]
    }
  },
  methods: {
    saveForm () {
      this.$router.push({
        path: 'rentInfo'
      })
    },
    // 文件上传完毕后会触发after-read回调函数，获取到对应的file对象
    afterRead (file) {
      // 此时可以自行将文件上传至服务器
      console.log(file)
    },
    onSelect (item) {
      // 点击选项时默认不会关闭菜单，可以手动关闭
      this.show = false
    }
  }
}
</script>

<style lang="stylus" scoped></style>
